package com.jade.bss.admin.account;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.*;

import com.jade.bss.base.BssConstants;

/**
 * 管理账号。.
 *
 * @author sky
 * @version 1.0 13-4-18 上午10:32
 */
@Entity
@Table (name = "BSS_ADMIN_ACCOUNT")
public class AdminAccount
        implements Serializable
{
    public final static String DEFAULT_OWNER_ID = BssConstants.OWNER_ID_SYSTEM;
    public final static String DEFAULT_OWNER_TYPE = BssConstants.OWNER_TYPE_SYSTEM;
    public final static String DEFAULT_TYPE = "system";
    /** admin status  正常 */
    public static int STATUS_NORMAL = 0;
    /** admin status 暂停 */
    public static int STATUS_SUSPEND = 1;
    /** admin identifier 超级管理员id 为1 */
    @Id
    @GeneratedValue (generator = "BSS_SEQ_ADMIN_ACCOUNT")
    @SequenceGenerator (name = "BSS_SEQ_ADMIN_ACCOUNT", initialValue = 100, sequenceName = "BSS_SEQ_ADMIN_ACCOUNT")
    private int id;
    /** 管理员类型 */
    @Column (name = "type", nullable = false, updatable = false, length = 32)
    private String type = DEFAULT_TYPE;
    /** CP/Agent/标识 */
    @Column (name = "owner_id", nullable = false, updatable = false, length = 64)
    private String ownerId = DEFAULT_OWNER_ID;
    /** 管理者类型（CP管理员、企业管理员、Agent管理员） */
    @Column (name = "owner_type", nullable = false, updatable = false, length = 32)
    private String ownerType = DEFAULT_OWNER_TYPE;
    /** 创建时间 */
    @Column (name = "creation_date", updatable = false)
    private Date creationDate;
    /** 账号名称 */
    @Column (name = "name", nullable = false, length = 64)
    private String name;
    /** 密码 加密 */
    @Column (nullable = false, length = 128)
    private String password;
    /** admin status */
    @Column (name = "status", nullable = false)
    private int status = STATUS_NORMAL;
    /** 真实名称 */
    @Column (name = "real_name", length = 64)
    private String realName;
    /** 性别 */
    @Column (name = "gender", length = 2)
    private int gender;
    /** 生日 */
    @Column (name = "birthday")
    private Date birthday;
    /** 电话 */
    @Column (name = "phone", length = 32)
    private String phone;
    /** 手机 */
    @Column (name = "mobile", length = 32)
    private String mobile;
    /** admin 邮件 */
    @Column (name = "email", length = 64)
    private String email;
    /** 地区 */
    @Column (name = "region", length = 64)
    private String region;
    /** 备注,描述 */
    @Column (name = "description", length = 128)
    private String description;
    /** 上次登陆时间 */
    @Column (name = "last_login_time")
    private Date lastLoginTime;
    /** 上次登录IP */
    @Column (name = "last_login_ip", length = 32)
    private String ip;
    @Column (name = "fid", length = 64)
    private String fId;
    /** 管理员头像 */
    private String logo;

    public int getId()
    {
        return id;
    }

    public void setId(int id)
    {
        this.id = id;
    }

    public Date getCreationDate()
    {
        return creationDate;
    }

    public void setCreationDate(Date creationDate)
    {
        this.creationDate = creationDate;
    }

    public String getName()
    {
        return name;
    }

    public void setName(String name)
    {
        this.name = name;
    }

    public String getRealName()
    {
        return realName;
    }

    public void setRealName(String realName)
    {
        this.realName = realName;
    }

    public int getGender()
    {
        return this.gender;
    }

    public void setGender(int gender)
    {
        this.gender = gender;
    }

    public Date getBirthday()
    {
        return birthday;
    }

    public void setBirthday(Date birthday)
    {
        this.birthday = birthday;
    }

    public String getPhone()
    {
        return phone;
    }

    public void setPhone(String phone)
    {
        this.phone = phone;
    }

    public String getMobile()
    {
        return mobile;
    }

    public void setMobile(String mobile)
    {
        this.mobile = mobile;
    }

    public String getPassword()
    {
        return password;
    }

    public void setPassword(String password)
    {
        this.password = password;
    }

    public String getEmail()
    {
        return email;
    }

    public void setEmail(String email)
    {
        this.email = email;
    }

    public Date getLastLoginTime()
    {
        return lastLoginTime;
    }

    public void setLastLoginTime(Date lastLoginTime)
    {
        this.lastLoginTime = lastLoginTime;
    }

    public String getRegion()
    {
        return region;
    }

    public void setRegion(String region)
    {
        this.region = region;

    }

    public String getIp()
    {
        return ip;
    }

    public void setIp(String ip)
    {
        this.ip = ip;
    }

    public String getOwnerId()
    {
        return ownerId;
    }

    public void setOwnerId(String ownerId)
    {
        this.ownerId = ownerId;
    }

    public String getOwnerType()
    {
        return ownerType;
    }

    public void setOwnerType(String ownerType)
    {
        this.ownerType = ownerType;
    }

    public String getDescription()
    {
        return description;
    }

    public void setDescription(String description)
    {
        this.description = description;
    }

    public int getStatus()
    {
        return status;
    }

    public void setStatus(int status)
    {
        this.status = status;
    }

    public String getType()
    {
        return type;
    }

    public void setType(String type)
    {
        this.type = type;
    }

    public String getfId()
    {
        return fId;
    }

    public void setfId(String fId)
    {
        this.fId = fId;
    }

    public String getLogo()
    {
        return logo;
    }

    public void setLogo(String logo)
    {
        this.logo = logo;
    }
}
